//
//  Toast.m
//  SulitLoan
//
//  Created by 虞嘉伟 on 2025/2/26.
//  
  

//#import <Toast/Toast.h>
#import "ResponseToast.h"

@implementation ResponseToast

+ (void)showToastWithRequest:(YTKRequest *)request {
    NSDictionary *dict = request.responseObject;
    if (![dict isKindOfClass:NSDictionary.class]) {
        return;
    }
    NSString *laughing = dict[@"laughing"];
    if (!laughing.length) {
        return;
    }
    //[UIApplication.sharedApplication.keyWindow.rootViewController.view makeToast:laughing];
    //[UIApplication.sharedApplication.keyWindow makeToast:laughing];
    UIView *view = UIApplication.sharedApplication.keyWindow;
    if ([view respondsToSelector:@selector(makeToast:)]) {
        [view performSelector:@selector(makeToast:) withObject:laughing];
    }
}
@end
